package com.example.javatwo.service.cg.wmj;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.javatwo.mapper.cg.wmj.SupplierMapping;
import com.example.javatwo.pojo.cg.wmj.Supplier;
import com.example.javatwo.pojo.cg.wmj.SupplierType;

@Service
public class SupplierService {
	@Autowired
	private SupplierMapping supplierMap;
	
	public List<Supplier> QuerySupplier(){
		List<Supplier> list = supplierMap.QuerySupplier();
		return list;
	}
	
	//新增
	public void InsertSupplier(Supplier sup){
		supplierMap.InsertSupplier(sup);
	}
	
	//分页查询
	public List<Supplier> QuerySupplierPage(@Param("currentPage")int currentPage){
		return supplierMap.QuerySupplierPage(currentPage);
	}
	
	public int QuerySumCount(){
		return supplierMap.QuerySumCount();
	}
	
	public String QueryID(){
		String id = supplierMap.QueryID();
		if(id!=null){
			id=String.valueOf(Long.parseLong(id)+1);
		}else{
			id="1";
		}
		return id;
	}
	
	public List<SupplierType> QueryType(){
		return supplierMap.QueryType();
	}
	
}
